#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mod_devicetable.h>

/*
 * //dts
 * ptest {
 *     compatible = "p001";
 * };
 */


int pdrv_probe(struct platform_device *pdev) {
	printk("-----probe-------\n");
	return 0;
}

int pdrv_remove(struct platform_device *pdev) {
	printk("-----remove-------\n");
	return 0;
}

static const struct of_device_id pof_match[] = {
	{ .compatible = "p001", }, //my test only this match dts node compatible "p001", also probe.
	{ },
};
MODULE_DEVICE_TABLE(of, pof_match);

static struct platform_driver pdrv= {
	.probe    = pdrv_probe,
	.remove   = pdrv_remove,
	.driver = {
		.owner  = THIS_MODULE,
		.name   = "ptest",  //my test only this match dts node "ptest", also probe.
		.of_match_table = pof_match,
	},
};
module_platform_driver(pdrv);

MODULE_LICENSE("GPL");
